package zeebe.subprocess;

import io.vertx.core.json.JsonObject;
import io.zeebe.client.ZeebeClient;
import io.zeebe.client.api.response.ActivatedJob;
import io.zeebe.client.api.worker.JobClient;
import io.zeebe.client.api.worker.JobHandler;

public class CCJobWorkerHandler implements JobHandler {
    ZeebeClient zeebeClient;

    public CCJobWorkerHandler(ZeebeClient client) {
        this.zeebeClient = client;
    }

    @Override
    public void handle(JobClient client, ActivatedJob job) throws Exception {
        System.out.println("开始执行CCJobWorker");

        JsonObject data = new JsonObject(job.getVariables());
        int CC=data.getInteger("CC");
        System.out.println("CCjobworker中 CC的值为"+CC);

        client.newCompleteCommand(job.getKey())
                .send()
                .join();
    }
}
